<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0">
	<title>注册</title>
	<script type="text/javascript" src="js/init.js"></script>
	<link rel="stylesheet" type="text/css" href="css/common.css">
	<link rel="stylesheet" type="text/css" href="css/info.css">
	<link rel="stylesheet" type="text/css" href="css/parsley.css">
</head>
<body>
	<div class="register-main">
		<a class="register-title" href="#">
			<img src="images/b.png" alt="">
		</a>
		<form id="register">
			<div class="item">
				<div>
					<div class="item-name"><i></i></div>
					<input type="text" name="" placeholder="请输入您的姓名" data-parsley-error-message="请输入您的姓名" required>
				</div>
			</div>
			<div class="item">
				<div>
					<div class="item-name">+86</div>
					<input type="text" name="" placeholder="请输入您的手机号码" data-parsley-pattern="1[3|4|5|8]{1}\d{9}" data-parsley-error-message="请输入正确的手机号码" required>
				</div>
			</div>
			<div class="item message-item">
				<div>
					<div class="item-name"><i></i></div>
					<input type="text" name="" placeholder="请输入短信验证码" data-parsley-error-message="输入姓名" required>
				</div>
				<a href="javascript:;" class="get-code">获取验证码</a>
			</div>
			<input type="submit" class="info-submit" name="" value="注册">
		</form>
	</div>
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/parsley.js"></script>
	<script type="text/javascript">
		$(function() {
			$('#register').parsley();

			//定时器
			var countdown = 60;
			$(".get-code").click(function() {
				if(!$(this).hasClass("disabled")) {
					settime($(this));
				}
			})

			function settime(ele) {
				if (countdown == 0) {
					ele.removeClass('disabled');
					ele.text("获取验证码");
					countdown = 60;
					return true;
				} else {
					ele.addClass('disabled');
					countdown--;
					ele.text(countdown + "S后重发");

					setTimeout(function() {
						settime(ele);
					},1000)

				}
			}
		})
	</script>
</body>
</html>